package com.yh.workbill;

import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeDemo {
    @Test
    public void time() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
//        System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
        String format = df.format(new Date());
        String[] split = format.split("-");
        for (String s : split) {
            System.out.println("===>" + s);
        }
    }
}
